package com.css.dzj.dzjjcss.modules.resultregister.mapper;

import com.css.dzj.dzjjcss.modules.resultregister.entity.ResultRegisterEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ResultRegisterMapper extends JpaRepository<ResultRegisterEntity, String>, JpaSpecificationExecutor<ResultRegisterEntity>,
        QuerydslPredicateExecutor<ResultRegisterEntity> {

    @Query(value = "select Org_Name, count(Org_Name) as total from RESULTREGISTER   where Status ='1' and del_Flag ='0'  group by Org_Name order by total desc ",
            nativeQuery = true)
    List<Object[]> chartList();
}